﻿/* 2011/11/20 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Cosmos.Shortcuts
{
    /// <summary>
    /// Provide simple settings of XmlReader and XmlWriter.
    /// </summary>
    static class SimpleXmlSettings
    {
        private static readonly XmlReaderSettings _xmlReaderSettings;
        private static readonly XmlWriterSettings _xmlWriterSettings;

        static SimpleXmlSettings()
        {
            _xmlReaderSettings = new XmlReaderSettings();
            _xmlReaderSettings.ConformanceLevel = ConformanceLevel.Fragment;
            _xmlReaderSettings.IgnoreWhitespace = true;
            _xmlReaderSettings.IgnoreComments = true;

            _xmlWriterSettings = new XmlWriterSettings();
            _xmlWriterSettings.ConformanceLevel = ConformanceLevel.Fragment;
            _xmlWriterSettings.Indent = false;
            _xmlWriterSettings.NewLineOnAttributes = false;
        }

        /// <summary>
        /// Gets settings of XmlReader.
        /// </summary>
        public static XmlReaderSettings ReaderSettings { get { return _xmlReaderSettings; } }

        /// <summary>
        /// Gets settings of XmlWriter.
        /// </summary>
        public static XmlWriterSettings WriterSettings { get { return _xmlWriterSettings; } }
    }
}
